/**
 * File:   fscript_exts.c
 * Author: AWTK Develop Team
 * Brief:  fscript_exts
 *
 * Copyright (c) 2023 - 2024  Guangzhou ZHIYUAN Electronics Co.,Ltd.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * License file for more details.
 *
 */

/**
 * History:
 * ================================================================
 * 2024-03-12 Li XianJing <xianjimli@hotmail.com> created
 *
 */

#include "tkc/fscript.h"
#include "hal/hmi_hal.h"

 ret_t func_beep_on(fscript_t* fscript, fscript_args_t* args, value_t* result) {
  return_value_if_fail(fscript != NULL && args != NULL && result != NULL, RET_BAD_PARAMS);
  return_value_if_fail(args->size == 1, RET_BAD_PARAMS);

  int nms = value_int(args->args);

  hmi_hal_beep_on(nms);
  log_debug("func_beep_on:%d\n", nms); 

  return RET_OK;
}

ret_t fscript_exts_init(void) {
  return fscript_register_func("beep_on", func_beep_on);
}
